import numpy as np
import cv2
img = cv2.imread("biden.jpg",cv2.IMREAD_COLOR)
qzimg = cv2.GaussianBlur(img,(3,3),0)
gray_img=cv2.cvtColor(qzimg,cv2.COLOR_RGB2GRAY)
#cv2.imshow("test",gray_img)
Sobel_x = cv2.Sobel(gray_img,cv2.CV_16S,1,0)
absX = cv2.convertScaleAbs(Sobel_x)
image = absX
ret, image = cv2.threshold(image, 0, 255, cv2.THRESH_OTSU)
cv2.imshow("test",image)
cv2.waitKey(0)










 
